package com.zy.explore.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.google.common.collect.Maps;
import com.zy.explore.annotation.DeSensitiveMethod;
import com.zy.explore.service.UserService;
import com.zy.explore.vo.ResultVO;
import com.zy.explore.vo.UserInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * description 用户控制器
 *
 * @author ZY
 * @date 2021年05月14日 21:27
 */
@Api(tags = "测试脱敏")
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @ApiOperationSupport(order = 10)
    @DeSensitiveMethod
    @ApiOperation("用户信息脱敏测试")
    @GetMapping("/getUserInfo1")
    public UserInfoVO getUserInfo1(@RequestParam String userId) {
        return userService.getUserInfo(userId);
    }

    @ApiOperationSupport(order = 20)
    @DeSensitiveMethod
    @ApiOperation("用户信息脱敏测试[包装类]")
    @GetMapping("/getUserInfo2")
    public ResultVO<UserInfoVO> getUserInfo2(@RequestParam String userId) {
        return ResultVO.getSuccess(userService.getUserInfo(userId));
    }

}
